/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.trick.admin.task;

import it.trick.admin.model.PreModel;
import it.trick.admin.service.PreService;
import javafx.concurrent.Service;
import javafx.concurrent.Task;

/**
 *
 * @author takahara
 */
public class AddPreTask extends Service<PreModel> {

    private PreModel preModel;

    public void setup(PreModel preModel) {
        this.preModel = preModel;
    }

    @Override
    protected Task createTask() {
        return new Task<PreModel>() {
            @Override
            protected PreModel call() throws Exception {

                PreModel model = PreService.addPre(preModel);

                return model;
            }
        };
    }
}
